/*
** get_params.c for zappy in /home/morgan_t/Documents/svn-for-my-proj/zappy/server/src
** 
** Made by thomas morgant
** Login   <morgan_t@epitech.net>
** 
** Started on  Thu Jul  5 11:32:58 2012 thomas morgant
** Last update Thu Jul  5 12:37:33 2012 thomas morgant
*/

#include "server.h"

void	get_params(t_serv *serv, int ac, char **av)
{
  int	i;

  i = 0;
  while (i < ac)
    {
      if (strncmp(av[i], "-p", 2) == 0)
	serv->port = atoi(av[i + 1]);
      if (strncmp(av[i], "-x", 2) == 0)
	  serv->width = atoi(av[i + 1]);
      if (strncmp(av[i], "-y", 2) == 0)
	  serv->height = atoi(av[i + 1]);
      if (strncmp(av[i], "-c", 2) == 0)
	  serv->client_in_team = atoi(av[i + 1]);
      if (strncmp(av[i], "-t", 2) == 0)
	  serv->time = atoi(av[i + 1]);
      if (strncmp(av[i], "-n", 2) == 0)
	{
	  serv->team1 = (av[i + 1]);
	  serv->team2 = (av[i + 2]);
	}
      i++;
    }
}
